home *** CD-ROM | disk | FTP | other *** search
- /* Poster current message på en annen BBS */
-
- def_bbsname = "UTBBS"
- def_conf = "ChitChat"
-
- options results
-
- if(substr(address(),1,4) ~= "THOR") then do
- parse arg portname
- if~(show(p, portname)) then do
- if ~(show(p, "THOR.01")) then do
- say "No THOR port found!"
- exit
- end
- else portname = "THOR.01"
- end
- end
- else portname = address()
-
- address(portname)
-
- address command "delete >NIL: <NIL: t:repost.msg"
- savemessage current noheader filename "t:RePost.msg"
-
- subj = getsubj()
- say subj
-
- do forever
- REQUESTLIST BBSLIST
- bbsname = result
- if(rc ~= 0|bbsname = "") then bbsname = def_bbsname
-
- REQUESTLIST CONFLIST BBS '"'bbsname'"'
- confname = result
- if(rc ~= 0) then confname = def_conf
-
- fname = "t:RePost.msg"
- ADDEVENT BBS '"'bbsname'"' EVENT ENTERMSG SENDTO '"'all'"' CONF '"'confname'"' MSGFILE '"'fname'"' SUBJECT '"'subj'"'
- if(rc ~= 0) then REQUESTNOTIFY TEXT '"Failed to post this time, try again?"' BT '"_Yes|_No"'
- else do
- PACKEVENTS '"'bbsname'"'
- return
- end
- end
-
- return
-
-
- getsubj:
- if open(fh, "t:RePost.msg") then do
- do i = 1 to 6
- subj = readln(fh)
- say i subj
- if instr(subj, subject) then do
- call close(fh)
- return(delstr(subj, 1, 9))
- end
- end
- call close(fh)
- end
- return subj
-
- instr: procedure
- parse arg; str = upper(arg(1)); pat = upper(arg(2))
- instring = pos(pat, str); if instring > 0 then return 1
- else return 0
- return 0
-